﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UofCASE.AgileProductLinerDSL;
using Microsoft.VisualStudio.Modeling;

namespace APLDTests {
    [TestClass]
    public class TestModelTest {
        //[TestMethod]
        //Name property of test model is no longer a calculated property
        public void TestGetCalculatedName() {
            ModelHelper model = ModelHelper.GetModel(true);
            Test test = model.GetElement<Test>("test");
            Assert.AreEqual("Not mapped to a test", test.Name);

            using (Transaction t = model.Store.TransactionManager.BeginTransaction("Set rel path.")) {
                test.RelativePath = @"\Folder\Test.html";
                test.ProjectUniqueName = @"Folder\Folder.csproj";
                test.IsMapped = true;
                t.Commit();
            }
            
            Assert.AreEqual("Test", test.Name);
            
        }
    }
}
